<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - cross_validate_track_association_trainer_abstract.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2014  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#undef</font> DLIB_CROSS_VALIDATE_TRACK_ASSOCIATION_TrAINER_ABSTRACT_Hh_
<font color='#0000FF'>#ifdef</font> DLIB_CROSS_VALIDATE_TRACK_ASSOCIATION_TrAINER_ABSTRACT_Hh_

<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='structural_track_association_trainer_abstract.h.html'>structural_track_association_trainer_abstract.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='svm_abstract.h.html'>svm_abstract.h</a>"

<font color='#0000FF'>namespace</font> dlib
<b>{</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font>
        <font color='#0000FF'>typename</font> track_association_function,
        <font color='#0000FF'>typename</font> detection_type,
        <font color='#0000FF'>typename</font> label_type
        <font color='#5555FF'>&gt;</font>
    <font color='#0000FF'><u>double</u></font> <b><a name='test_track_association_function'></a>test_track_association_function</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> track_association_function<font color='#5555FF'>&amp;</font> assoc,
        <font color='#0000FF'>const</font> std::vector<font color='#5555FF'>&lt;</font>std::vector<font color='#5555FF'>&lt;</font>std::vector<font color='#5555FF'>&lt;</font>labeled_detection<font color='#5555FF'>&lt;</font>detection_type,label_type<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> samples
    <font face='Lucida Console'>)</font>;
    <font color='#009900'>/*!
        requires
            - is_track_association_problem(samples)
            - track_association_function == an instantiation of the dlib::track_association_function
              template or an object with a compatible interface.
        ensures
            - Tests assoc against the given samples and returns the fraction of detections
              which were correctly associated to their tracks.  That is, if assoc produces
              perfect tracks when used then this function returns a value of 1.  Similarly,
              if 5% of the detections were associated to the incorrect track then the
              return value is 0.05.
    !*/</font>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font>
        <font color='#0000FF'>typename</font> trainer_type,
        <font color='#0000FF'>typename</font> detection_type,
        <font color='#0000FF'>typename</font> label_type
        <font color='#5555FF'>&gt;</font>
    <font color='#0000FF'><u>double</u></font> <b><a name='cross_validate_track_association_trainer'></a>cross_validate_track_association_trainer</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> trainer_type<font color='#5555FF'>&amp;</font> trainer,
        <font color='#0000FF'>const</font> std::vector<font color='#5555FF'>&lt;</font>std::vector<font color='#5555FF'>&lt;</font>std::vector<font color='#5555FF'>&lt;</font>labeled_detection<font color='#5555FF'>&lt;</font>detection_type,label_type<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> samples,
        <font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> folds
    <font face='Lucida Console'>)</font>;
    <font color='#009900'>/*!
        requires
            - is_track_association_problem(samples)
            - 1 &lt; folds &lt;= samples.size()
            - trainer_type == dlib::structural_track_association_trainer or an object with
              a compatible interface.
        ensures
            - Performs k-fold cross validation by using the given trainer to solve the
              given track association learning problem for the given number of folds.  Each
              fold is tested using the output of the trainer and the fraction of
              mis-associated detections is returned (i.e. this function returns the same
              measure of track association quality as test_track_association_function()).
            - The number of folds used is given by the folds argument.
    !*/</font>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_CROSS_VALIDATE_TRACK_ASSOCIATION_TrAINER_ABSTRACT_Hh_
</font>


</pre></body></html>